<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo Configure::read('Site.charset'); ?>" xml:lang="<?php echo Configure::read('Site.charset'); ?>">
<head>
	<?php echo $html->charset(); ?>
	<title>
		<?php echo $title_for_layout; ?> /
		<?php echo Configure::read('Site.sitename'); ?>
	</title>
	<?php
		echo $html->meta('icon', $html->url('/img/favicon.ico'));
		
		echo $html->meta(Configure::read('Site.rss_title'), array('plugin'=>'posts', 'controller'=>'posts', 'action'=>'feed', 'ext'=>'rss'), array('type' => 'rss') );
		
		//echo $html->css('/extend/css/dev');
		
		echo $html->css('/extend/css/nyromodal');
		
		echo $html->css('tapr');
		
		echo $html->css('datepicker');
		
		echo $javascript->link('/extend/js/jquery'); 
		
		echo $javascript->link('/extend/js/nyromodal');
		
		echo $javascript->link('datepicker/datepicker'); 
		
		echo $javascript->link('datepicker/eye');
		
		echo $javascript->link('datepicker/utils');
		
		echo $javascript->link('tapr'); 

		echo $scripts_for_layout;
	?>
</head>
<?php if($this->params['controller'] != "pages") {
	$body_id = $this->params['controller'];
} else {
	$body_id = $this->params['pass'][count($this->params['pass'])-1];
}?>
<body id="<?php echo $body_id; ?>">
		<div id="container"> 
			<div id="header">
				<strong class="logo"><?php echo $html->link(Configure::read('Site.sitename'), '/'); ?></strong>
				<ul class="toplinks">
					<?php if($user):?>
						<li><?php echo $html->link(__('Home', true), array('controller' => 'workouts', 'action' => 'index')); ?></li>
						<li><?php echo $html->link(__('Profile', true), array('controller' => 'users', 'action' => 'view', $user['User']['username'])); ?></li>
						<li><?php echo $html->link(__('Settings', true), array('controller' => 'users', 'action' => 'settings')); ?></li>
						<li><?php echo $html->link(__('Help', true), array('controller' => 'pages', 'action' => 'display', 'help')); ?></li>
						<li><?php echo $html->link(__('Logout', true), array('controller' => 'users', 'action' => 'logout')); ?></li>
					<?php else: ?>
					<li><?php echo $html->link(__('Login', true), array('controller' => 'users', 'action' => 'login')); ?>
					</li>
					<li><?php echo $html->link(__('Join Tapr', true), array('controller' => 'users', 'action' => 'register')); ?>
					</li>
					<?php endif; ?>
				</ul>
			</div>
			<div id="nav">
				
				<h1><?php echo $this->pageTitle; ?></h1>
				<ul>
					<li class="workouts"><?php echo $html->link(__('Workouts', true), array('controller' => 'workouts', 'action' => 'index')); ?></li>
					<li class="organize"><?php echo $html->link(__('Organize', true), array('controller' => 'templates', 'action' => 'index')); ?></li>
					<li class="analyze"><?php echo $html->link(__('Analyze', true), array('controller' => 'graph', 'action' => 'index')); ?></li>
				</ul>
			</div>
			<div id="content">
				<?php $session->flash(); ?>
				<?php $session->flash('auth'); ?>
				<?php echo $content_for_layout; ?>

			</div>
		
		
		
		</div>
		<div id="footer">
			<p>Tapr 2009</p>
		</div>
	
	<div id="debug">
	<?php echo $cakeDebug; ?>
	</div>
	<?php echo Configure::read('Site.footer'); ?>
</body>
</html>